package com.qst.chapter05;

import java.util.Timer;
import java.util.TimerTask;

class EatTimerTask extends TimerTask{

	@Override
	public void run() {
		System.out.println("Eat");
		
	}
	
}

public class TimeDemo {

	public static void main(String[] args) {
		EatTimerTask task = new EatTimerTask();
		
		
		
				Timer timer =new Timer();
		timer.schedule((TimerTask) task, 0,1000);

	}

}
